--[[/**
-- * 
 * 幸运之盾 的负面效果, 身上如果有这个
 * 揍身上带着幸运之盾的人会被减免伤害
 *
-- */]]

---@class BuffEffect64101 : BaseBuffEffect
BuffEffect64101 = ClientFight.CreateClass("BuffEffect64101", ClientFight.BaseBuffEffect)
local t = BuffEffect64101
local BuffEffect64101 = "BuffEffect64101_Overlay";
---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...};

    if (parameters[1]) then
    else
        return IBuffEffect.FAIL;
    end
    local debuf = parameters[1];
    local f_tag = debuf.buffBean.f_Tag;
    if (debuf.buffBean.f_BuffType == BuffTypeEnum.NEGATIVE) then
    elseif (f_tag ~= nil and ArrayUtils.contains(f_tag, FighterSignEnum.TAG_23)) then
    else
        return IBuffEffect.FAIL;
    end
    local debuffSets = buff.target.parametersByObject[BuffEffect64101] or {};
    if (not debuffSets.add(debuf.modelId)) then
        return IBuffEffect.FAIL;
    end
    buff.target.parametersByObject[BuffEffect64101] = debuffSets;
    SkillRoleMgr.savePathFile(string.format("[%s][EFFECT]Fighter:%s Buff:%s 增加幸运之盾的负面效果, 当前数量个数 : %s",
            fight.frame, buff.target.fighterId, buff.modelId, table.getn(debuffSets)));
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end
function t:remove(fight, buff, force, ...)
    if (force) then
        return ClientFight.BaseBuffEffec.remove(fight, buff, force, ...);
    end
    if (parameters[1]) then
    else
        return IBuffEffect.FAIL;
    end
    local triggerBuff = parameters[1];
    local f_tag = triggerBuff.buffBean.f_Tag;
    if (triggerBuff.buffBean.f_BuffType == BuffTypeEnum.NEGATIVE) then
    elseif (f_tag ~= nil and table.contains(f_tag, FighterSignEnum.TAG_23)) then
    else
        return IBuffEffect.FAIL;
    end
    local o = buff.target.parametersByObject[BuffEffect64101];
    if (o == nil) then
        return IBuffEffect.FAIL;
    end
    local debuffSets = o;
    if (debuffSets.isEmpty()) then
        return IBuffEffect.FAIL;
    end
    debuffSets.remove(triggerBuff.modelId);
    SkillRoleMgr.savePathFile(string.format("[%s][EFFECT]Fighter:%s Buff:%s 减少幸运之盾的负面效果, 当前数量个数 : %s",
            fight.frame, buff.target.fighterId, buff.modelId, table.getn(debuffSets)));
    return IBuffEffect.FAIL;
end

t.New()